package org.csmzxy.class233;

public class Example01 {
    public static void main(String[] args) throws InterruptedException{
        //创建两个自定义线程对象
        MyThread01 thread01 = new MyThread01();
        MyThread01 thread02 = new MyThread01();
        //为thread02线程对象设置名称
        thread02.setName("thread02");
        //启动线程
        thread01.start();
        thread02.start();
        //在main()方法中执行while循环
        while (true) {
            System.out.println("main()方法在运行");
            //让当前线程休眠1000毫秒
            Thread.sleep(1000);
        }
    }
}
